<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/common/header.jsp"%>
<script type="text/javascript" src="../../js/deptSingleSelect.js"></script>
<script type="text/javascript" src="../../js/roleSingleSelect.js"></script>
<a href="" title="用户激活"></a>
<script type="text/javascript">

Ext.onReady(function(){
    Ext.BLANK_IMAGE_URL = ' ../../js/ext/images/default/s.gif'; 
    // ---------------------- Global vars and functions------------------------------
    Ext.SERVER = '<c:url value="/"/>';
     // 得到url参数
      function GetUrlParms()    
    {
         var args=new Object();   
         var query=location.search.substring(1);//获取查询串   
         var pairs=query.split("&");//在逗号处断开   
         for(var    i=0;i<pairs.length;i++)   
         {   
             var pos=pairs[i].indexOf('=');//查找name=value   
             if(pos==-1)   continue;//如果没有找到就跳过   
             var argname=pairs[i].substring(0,pos);//提取name   
             var value=pairs[i].substring(pos+1);//提取value   
             args[argname]=unescape(value);//存为属性   
        }
         return args;
    }
    
    
  Ext.QuickTips.init();
    Ext.override(Ext.form.Field, 
    {   afterRender : Ext.form.Field.prototype.afterRender.createSequence(function()
        {
            var qt = this.qtip;
            if (qt)
            {   Ext.QuickTips.register({
                target:  this,
                title: '',
                css : 'background:#ff0000;',
                text: qt,
                enabled: true,
                showDelay: 20
                });
            }
        })
    });
    
	var params = GetUrlParms();
   //---------------------form-------------------
    
      var masterFrom = new Ext.form.FormPanel({
        buttonAlign:'center',
        frame: true,
        layout: 'form',
        labelWidth: 65
    });
    
//-----------------Viewport------------
        var viewport = new Ext.Viewport({
        layout: 'fit',
        border: false,   
        items: [
                    masterFrom
                ]
    });
     
     		masterFrom.getForm().load({
            // url: '<c:url value="/usergroup/userGroupNodeInfo.do"/>',      
             url: Ext.SERVER+'mail/userActivation.do',
            // method: 'get',
             params: {
                 userid: params['uid'],
                 loginid: params['lid'],
                 millis:params['ms']
             },
             waitMsg: 'loading...',
             timeout: 30,
             success:function(response, action){
             text = action.response.responseText;
	            json = Ext.decode(text);
	            if(json.success == true){  
	              Ext.Msg.alert('提示', json.msg);
	             } else {
	                 Ext.Msg.alert('提示', '用户激活成功');
	             }
	             },
             failure: function(response, action) {
                 text = action.response.responseText;
                 json = Ext.decode(text);
                 if(json.success == false){  
                  Ext.Msg.alert('提示', json.msg);
                  } else {
                 Ext.Msg.alert('提示', '用户激活失败请重新激活');
                 }                             
             }
         });   
     
   });   
     
</script>
<%@ include file="/WEB-INF/views/common/footer.jsp"%>
